﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleTest
{
    class GUIDTest
    {
        static void Main(string[] args)
        {
            string str = null;
            Guid guid = Guid.Empty;
            for (int i = 0; i < 10; i++)
            {
                guid = Guid.NewGuid();

                str = Convert.ToBase64String(guid.ToByteArray());

                Console.WriteLine(str);
            }

            Console.WriteLine("长度为" + str.Length);//24

            Console.WriteLine(guid.ToString());
            Console.WriteLine("长度为" + guid.ToString().Length);//36

            guid = Guid.Empty;

            str = Convert.ToBase64String(guid.ToByteArray());

            Console.WriteLine(str);
            Console.WriteLine("长度为" + str.Length);//24

            Console.WriteLine(guid.ToString());
            Console.WriteLine("长度为" + guid.ToString().Length);//36

            guid = Guid.NewGuid();

            Console.WriteLine(guid.ToString("N"));//32
        }
    }
}
